package PolymorphicHomeworkTest2;

public class SalesEmployee extends Employee{
    private double saleroom;
    private double royaltyRate;

    public SalesEmployee() {
    }

    public SalesEmployee(String name,int month,double saleroom, double royaltyRate) {
        super(name,month);
        this.saleroom = saleroom;
        this.royaltyRate = royaltyRate;
    }

    public double getSaleroom() {
        return saleroom;
    }

    public void setSaleroom(double saleroom) {
        this.saleroom = saleroom;
    }

    public double getRoyaltyRate() {
        return royaltyRate;
    }

    public void setRoyaltyRate(double royaltyRate) {
        this.royaltyRate = royaltyRate;
    }

    public double getSalary(int month){
        double sumSalary = 0;
        sumSalary =(this.saleroom * this.royaltyRate);
        if(super.getMonth() == month){
            sumSalary += 100;
        }
        return sumSalary;
    }
}
